//package leetcode;
//
//import java.util.HashSet;
//import java.util.Set;
//
//class Solution {
//    public int arithmeticTriplets(int[] nums, int diff) {
//        int n = nums.length;
//        Set<Integer> set = new HashSet<>();
//        int ans = 0;
//        for (int i = 0; i < n; i++) {
//            if(set.contains(nums[i] - 2* diff) && set.contains(nums[i] - diff)) + ans;
//        }
//    }
//}
//
//public class Test2 {
//}
